/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body,
#root {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: #001529;
  color: #fff;
  overflow: hidden;
}

.dashboard {
  height: 100vh;
  width: 100vw;
  background-color: rgba(17, 70, 94, 0.95);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  height: 150px;
  /* background-image: url("/header-bg.svg"); */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  display: flex;
  /* padding: 0 57px; */
  overflow: hidden;
}

.header-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  z-index: 1;
  width: 100%;
  /* padding-bottom: 70px; */
  height: 80px;
  background-color: #0b2c45;
  padding: 0 57px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 50px;
  height: 100%;
}

.nav-links-container {
  display: flex;
  align-items: center;
  position: relative;
  max-width: 620px;
}

.nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background-color: rgba(0, 180, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  z-index: 2;
  transition: background-color 0.3s;
  font-weight: bold;
}

.nav-arrow:hover {
  background-color: rgba(0, 180, 255, 0.4);
}

.nav-arrow-left {
  margin-right: 10px;
}

.nav-arrow-right {
  margin-left: 10px;
}

.nav-arrow.hidden {
  opacity: 0;
  pointer-events: none;
}

.header-help,
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  /* justify-content: center; */
  gap: 100px;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  max-width: 520px;
  overflow-x: scroll;
  white-space: nowrap;
  height: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

.header-user-logout {
  cursor: pointer;
  margin-left: -10px;
  color: rgb(209, 61, 61);
  font-weight: bold;
}

.nav-link {
  cursor: pointer;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.header-bg {
  width: 100vw;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 0;
}

.logo {
  width: 138px;
  height: auto;
  filter: drop-shadow(0 0 8px rgba(0, 180, 255, 0.3));
}

.title {
  color: #fff;
  font-size: 28px;
  font-weight: 500;
  margin: 0;
  text-shadow: 0 0 20px rgba(0, 180, 255, 0.5);
}

.dashboard-content {
  flex: 1;
  display: grid;
  grid-template-columns: 2fr 3fr 2fr;
  gap: 16px;
  padding: 24px;
  padding-top: 12px;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  /* background-color: #11465e 95; */
}

.left-panel {
  display: flex;
  flex-direction: column;
  /* gap: 16px; */
  min-height: 0;
}

.energy-history,
.energy-distribution {
  flex: 1;
  min-height: 0;
}

.energy-history::after,
.energy-distribution::after {}

.center-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.center-panel .container {
  padding-bottom: 60px;
}

.digital-map-container {
  flex: none;
  height: 66.6%;
  min-height: 0;
}

.digital-map-container::after {}

.title {
  font-size: 28px;
  font-weight: bold;
  color: #fff;
}

.real-time-monitor {
  flex: none;
  width: 352px;
  /* height: calc(33.33% - 16px);
  min-height: calc(33.33% - 16px); */
}

.real-time-monitor::after {}

.indicator-analysis {
  width: 100%;
  height: 100%;
}

.indicator-analysis::after {}

.right-panel {
  display: flex;
  flex-direction: column;
  /* gap: 16px; */
  min-height: 0;
  min-width: 100%;
}

.right-panel-top {
  flex: 1;
  min-height: calc(33.33% - 16px);
  height: calc(33.33% - 16px);
}

.right-panel-top::after {}

.right-panel-mid {
  flex: 1;
  min-height: calc(33.33% - 16px);
  height: calc(33.33% - 16px);
}

.right-panel-mid::after {}

.right-panel-bottom {
  height: calc(33.33% - 16px);
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  min-height: 0;
}

.right-panel-bottom>* {
  background: rgba(0, 24, 51, 0.7);
  border: 1px solid rgba(0, 180, 255, 0.2);
  border-radius: 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.right-panel-bottom>*::after {}

.monitor-section,
.analysis-section {
  flex: 1;
  min-height: 0;
}

.monitor-section::after,
.analysis-section::after {}

.content-card-base {
  position: relative;
  /* padding: 16px; */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.content-card-base>* {
  position: relative;
  z-index: 2;
}

.content-card-base::after {
  /* content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-image: url("/底@3x.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
  transform-origin: center;
  transform: scale(1.002); */
}

.content-card-base h2,
.content-card-base h3,
.content-card-base h4 {
  position: relative;
  z-index: 2;
  text-shadow: none;
}

.digital-map-container.content-card-base {
  flex: none;
  height: 66.6%;
  min-height: 0;
}

.real-time-monitor.content-card-base {
  flex: none;
  height: calc(33.33% - 16px);
  min-height: calc(33.33% - 16px);
}

.indicator-analysis.content-card-base {
  flex: none;
  height: calc(33.33% - 16px);
}

.right-panel-top.content-card-base {
  flex: 1;
  min-height: calc(64% - 16px);
  height: calc(64% - 16px);
}

.right-panel-top.content-card-base .normal-card {
  padding-bottom: 0;
}

.right-panel-mid.content-card-base {
  flex: 1;
  min-height: calc(22.22% - 16px);
  height: calc(22.22% - 16px);
}

.energy-history.content-card-base,
.energy-distribution.content-card-base {
  flex: 1;
  min-height: 0;
}

h2 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
}

.chart-container {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.dashboard-title {
  position: relative;
  text-align: center;
  font-size: 24px;
  color: #00b4ff;
  margin: 8px 0 16px;
  text-shadow: 0 0 10px rgba(0, 180, 255, 0.6);
}

.dashboard-title::before,
.dashboard-title::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 200px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00b4ff, transparent);
}

.dashboard-title::before {
  left: calc(50% - 300px);
}

.dashboard-title::after {
  right: calc(50% - 300px);
}

.energy-monitor {
  /* background: rgba(0, 21, 41, 0.6); */
  border-radius: 4px;
  flex-shrink: 0;
  height: 100%;
  /* height: calc(33.33% - 16px); */
}

.energy-monitor h2 {
  font-size: 16px;
  margin-bottom: 24px;
}

.monitor-content {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  /* height: calc(100% - 40px); */
}

.energy-value {
  width: 50%;
}

.energy-value,
.energy-rate {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: #BBBBBB;
  padding: 20px;
  border-radius: 20px;
  color: #000;
}

.energy-rate {
  padding: 12px 27px;
  margin-left: 20px;
  gap: 0px;
}

.energy-rate .value {
  font-size: 20px;
  font-weight: bold;
}

.value {
  font-size: 36px;
  /* color: #1890ff; */
  font-weight: bold;
}

.unit {
  font-size: 12px;
  margin-left: 4px;
  /* color: rgba(255, 255, 255, 0.85); */
}

.percentage {
  /* color: #52c41a; */
  font-size: 20px;
  font-weight: 500;
}

.label {
  font-size: 12px;
  /* color: rgba(255, 255, 255, 0.65); */
}

.digital-map {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.digital-map h2 {
  font-size: 16px;
  margin-bottom: 16px;
}

.map-container {
  flex: 1;
  /* border: 1px solid rgba(24, 144, 255, 0.3); */
  border-radius: 4px;
  position: relative;
  transition: transform 0.3s ease;
  overflow: hidden;
  min-height: 0;
  /* background: rgba(0, 21, 41, 0.4); */
}

.node {
  position: absolute;
  padding: 12px;
  background: rgba(0, 21, 41, 0.8);
  border: 1px solid #1890ff;
  border-radius: 4px;
  min-width: 160px;
}

.node-name {
  font-size: 14px;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.85);
}

.node-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.node.normal {
  border-color: #52c41a;
}

.node.warning {
  border-color: #faad14;
}

.node.error {
  border-color: #f5222d;
}

.map-controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 8px;
}

.map-controls button {
  width: 32px;
  height: 32px;
  background: #1890ff;
  border: none;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alert-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  height: 320px;
}

.alert-panel h2 {
  font-size: 16px;
  margin-bottom: 16px;
}

.alert-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-shrink: 0;
  gap: 8px;
}

.stat-item {
  text-align: center;
  padding: 4px;
  border-radius: 4px;
  flex: 1;
  display: flex;
  flex-direction: column;
  /* gap: 4px; */
}

.stat-item .count {
  font-size: 20px;
  font-weight: 500;
}

.stat-item .label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.stat-item.critical {
  background: rgba(245, 34, 45, 0.2);
}

.stat-item.warning {
  /* background: rgba(250, 173, 20, 0.2); */
}

.stat-item.normal {
  background: rgba(82, 196, 26, 0.2);
}

.alert-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 12px;
  min-height: 0;
}

.alert-list::-webkit-scrollbar {
  width: 4px;
}

.alert-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.alert-list::-webkit-scrollbar-thumb {
  background: rgba(24, 144, 255, 0.5);
  border-radius: 2px;
}

.alert-item {
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 4px;
  background: rgba(0, 21, 41, 0.6);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.alert-item:last-child {
  margin-bottom: 0;
}

.alert-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.alert-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.alert-status {
  font-size: 12px;
  color: #1890ff;
}

.alert-pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 8px 0;
  flex-shrink: 0;
}

.alert-pagination button {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid #1890ff;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.alert-pagination button.active {
  background: #1890ff;
}

.event-trend {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.event-trend h2 {
  font-size: 16px;
  margin-bottom: 16px;
}

.trend-chart {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.color-dot.level-1 {
  background: #1890ff;
}

.color-dot.level-2 {
  background: #52c41a;
}

.color-dot.level-3 {
  background: #faad14;
}

.chart-container {
  flex: 1;
  /* border: 1px solid rgba(24, 144, 255, 0.3); */
  border-radius: 4px;
  overflow: hidden;
  min-height: 0;
  /* background: rgba(0, 21, 41, 0.4); */
  /* padding: 16px; */
}

.dashboard-footer {
  height: 80px;
  background-color: #98b0bd;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  position: relative;
  overflow: hidden;
}

.dashboard-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
}

.footer-content {
  position: relative;
  color: #101010;
  font-size: 14px;
  z-index: 1;
  padding-left: 40vw;
  line-height: 22px;
}

.red-label {
  color: #f5222d;
}

.yellow-label {
  color: #faad14;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 36, 77, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 180, 255, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 180, 255, 0.5);
}

.footer-panel {
  height: 25vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  width: 100vw;
  padding-bottom: 24px;
  gap: 10px;
}

.energy-distribution {
  width: calc(25% + 72px);
}

.monitor-analysis-container {
  width: calc(75% - 72px);
  display: flex;
  align-items: center;
  height: 100%;
}

.monitor-analysis-container-content {
  display: flex;
  align-items: flex-start;
  width: 100%;
  padding: 0 16px;
  gap: 16px;
  padding-bottom: 24px;
  height: 100%;
  margin-top: -6px;
  /* padding-left: 30px; */
  /* padding-right: 30px; */
}

.line {
  height: 100%;
  width: 1px;
  background-color: #fff;
}

